<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String pageIndex ;
	   pageIndex=request.getParameter("pageIndex");

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><s:property value="title"/></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	
	<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> 
    <link href="css/AeroWindow.css?r=123" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" type="text/css" href="css/lksMenuSkin.css" />
	<link rel="stylesheet" type="text/css" href="css/user_home.css" />
	
	<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> 
    <script type="text/javascript" src="js/jquery-ui-1.8.1.custom.min.js"></script> 
    <script type="text/javascript" src="js/jquery.easing.1.3.js"></script>         
    <script type="text/javascript" src="js/jquery-AeroWindow.js"></script>
    <script type="text/javascript" src="js/jquery.lksMenu.js"></script>
	<script type="text/javascript" src="js/city.js"></script>
	<script type="text/javascript">
        $('document').ready(function(){
            $('.menu').lksMenu();
        });
        function checkLogout(){
        	if(!confirm(" 您确定要离开设计之路IT技术社区吗？ ")){
				return false;
			}
			else{
				return true;
			}
        }
    </script>
	 <script type="text/javascript">
		function getFullPath(obj){ 
		    if(obj)   
		    {   
		        //ie   
		        if (window.navigator.userAgent.indexOf("MSIE")>=1)   
		        {   
		            obj.select();   
		            return document.selection.createRange().text;   
		        }   
		        //firefox   
		        else if(window.navigator.userAgent.indexOf("Firefox")>=1)   
		        {   
		            if(obj.files)   
		            {   
		                return obj.files.item(0).getAsDataURL();   
		            }   
		            return obj.value;   
		        }   
		        return obj.value;   
		    }  
		}   
		function check(){
			if($("#uploadFile").val()==null||$("#uploadFile").val()=="")
			{
				alert("请选择头像！！");
				return false;
		    }
		}
	</script>
  </head>
  
  <body onLoad="setup()" background="images/bg_img2.jpg" style="background-repeat: no-repeat; background-color: black;">
    <div>
    	<span class="reference">
    		<span style="color: white;">${user.account}的个人空间&nbsp;&nbsp;&nbsp;</span>
    		<s:a href="user_logout" onclick="return checkLogout()">注销</s:a>
    		<s:a href="#">SJZL首页</s:a>
    		<s:a href="#">业内资讯</s:a>
    		<s:a href="board_list">论坛首页</s:a>
    		<s:a href="#">博客</s:a>
    		<s:a href="#">下载</s:a>
    		<s:a href="#">图书馆</s:a>
    	</span>
	</div>
	
	<br/><br/><br/>
	<div style="width: 960px;; background-color: white; margin: auto; position: relative;">
	<!-- 菜单 begin -->
	<div class="menu" style="width: 250px; position: absolute; left: 0px; top: 0px; border: 2px solid;">
        <ul>
            <li>
                <a style="cursor: pointer;">个人信息</a>
                <ul>
                	<li><s:a href="user_myselfInfo?selectAccount=%{#session.sessionUser.account}">基本信息</s:a></li>
                	<li><s:a href="user_updateUserUI?selectAccount=%{#session.sessionUser.account}">修改资料</s:a></li>
                	<li><s:a href="user_releaseMoodUI?selectAccount=%{#session.sessionUser.account}">发布心情</s:a></li>
                    <li><s:a href="user_selectMessageUI?selectAccount=%{#session.sessionUser.account}">留言板</s:a></li>
                </ul>
            </li>
            <li>
                <a style="cursor: pointer;">我的好友</a>
                <ul>
                    <li><s:a href="user_myfriendUI?selectAccount=%{#session.sessionUser.account}">查看好友列表</s:a></li>
                    <li><a href="#">好友动态</a></li>
                </ul>
            </li>
            <li>
                <a style="cursor: pointer;">我的博客</a>
                <ul>
                    <li><a href="#">我的文章</a></li>
                    <li><a href="#">写文章</a></li>
                    <li><a href="#">我的相册</a></li>
                </ul>
            </li>
        </ul>
    </div>
	<!-- 菜单 end -->
	
	<!-- 主要内容 -->
	<div class="main_content">
		<br/>
		  <form action="user_updateUser" method="post" enctype="multipart/form-data" name="form1" onsubmit="return check();">
			<div style="width: 95%; height: 135px; position: relative; margin: auto; border: 2px solid black;">
				<table border="0">
					<tr>
						<td style="width: 20%;">
							<div style="width: 120px; height: 120px; margin: 5px 5px 5px 5px;">
							<img id="img" width="120" height="120" src="userUploadFile/${user.headImageSrc }"></img>
							</div>
						</td>
						<!-- 在这里做头像上传的功能 -->
						<td>
							选择头像：
							<input type="file" name="upload" id="uploadFile" onchange="document.getElementById('img').src=getFullPath(this);" value="${user.headImageSrc}" /><br/>
							<span style="color: red;">只能上传图片格式文件</span>
						</td>
						<!-- 在这里做头像上传的功能 end -->
					</tr>
				</table>
			</div>
			<br/>
			
			<div style="width: 95%; position: relative; margin: auto; border: 2px solid black;">
				<table cellspacing="0" class="mytable">
					<tr>
						<th scope="col" style="width: 20%;">主题</th> 
						<th scope="col">内容</th>
					</tr>
					<tr>
						<td style="width: 15%;">姓名：</td>
						<td><input type="text" name="user.name"value="${user.name}" /></td>
					</tr>
					<tr>
						<td style="width: 15%;">性别：</td>
						<td>
							<s:select name="user.sex" list="{'-','男','女'}" value="%{user.sex}"></s:select>
						</td>
					</tr>
					<tr>
						<td style="width: 15%;">邮箱：</td>
						<td><input disabled="disabled" type="text" name="user.email"value="${user.email}" />*注册邮箱不能修改</td>
					</tr>
					<tr>
						<td style="width: 15%;">所在城市：</td>
						<td>
							<!--<select id="s1" style="width:140px"><option>${user.country }</option></select>    
							<select id="s2"><option>${user.province }</option></select>    
							<select id="s3"><option>${user.city }</option></select>--> 
							<input type="hidden" name="user.account" value="${user.account }"/>
							国家：<input type="text" name="user.country" value="${user.country }"size="10" />
							省份：<input type="text" name="user.province" value="${user.province }" size="10"/>
							城市：<input type="text" name="user.city" value="${user.city }" size="10"/>
						</td>
					</tr>
					<tr>
						<td style="width: 15%;">所属行业：</td>
						<td><input type="text" name="user.industry"value="${user.industry}" /></td>
					</tr>
					<tr>
						<td style="width: 15%;">职业：</td>
						<td><input type="text" name="user.vocation"value="${user.vocation}" /></td>
					</tr>
					<tr>
						<td style="width: 15%; height: 50px;">自我简介：</td>
						<td><textarea rows="6" cols="50" name="user.introduction">${user.introduction}</textarea></td>
					</tr>
					<tr>
						<td style="width: 15%;"></td>
						<td>
							<input type="submit" value="修改" style="width: 80px; height: 25px;"/>
							<input type="reset" value="重置" style="width: 80px; height: 25px;"/>
						</td>
					</tr>
				</table>
			</div>
		  </form>
		<br/>
	</div>
	<!-- 主要内容  end-->
	</div>
	
	<s:include value="/bottom.jsp"></s:include>
  </body>
</html>
